package com.xuruzi.demo.util.request;

import com.xuruzi.demo.util.MessageBuilder;
import lombok.Data;

/**
 * Created by xuruzi on 2020/3/28.
 */
@Data
public class BaseReqMsg {
    String toUserName;
    String fromUserName;
    long createTime;
    String msgType;
    String msgId;
    String agentId;

    public String toXml() {
        MessageBuilder builder = new MessageBuilder(159);
        builder.addData("ToUserName", this.getToUserName());
        builder.addData("FromUserName", this.getFromUserName());
        builder.addData("MsgId", this.getMsgId());
        builder.addData("MsgType", this.getMsgType());
        builder.addData("AgentID", this.getAgentId());
        builder.addTag("CreateTime", String.valueOf(System.currentTimeMillis()).substring(0, 10));
        return builder.toString();
    }
}
